package com.medusa.aps.business.modules.basic.mp.task;

import com.medusa.aps.business.modules.basic.mp.service.WorkingCalendarService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author miskw
 * @date 2023/11/29
 * @describe 工作日历自动延长
 */
@Slf4j
@Component
public class WorkingCalendarTask {
    @Resource
    private WorkingCalendarService workingCalendarService;

    /**
     * 每年7月1日自动更新工作日历
     */
    @Scheduled(cron = "0 0 0 1 7 ? ")
    public void generateWorkingCalendar() {
        workingCalendarService.generateWorkingCalendar();
    }
}
